<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Primeira Face</title>
        <link href="./resources/css/default.css" rel="stylesheet" type="text/css" />
        <link href="./resources/css/cssLayout.css" rel="stylesheet" type="text/css" />
    </h:head>
    <h:body>
                <h:form id="form">
                    <p:dataTable id="tbl" var="servicoList" value="#{requestServiceSabatecBean.requestServicos}" paginator="true" rows="5" >  

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="ID" />  
                            </f:facet>  
                            <h:outputText value="#{servicoList.id}" />  
                        </p:column>

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Cliente" />  
                            </f:facet>  
                            <h:outputText value="#{servicoList.cliente}" />  
                        </p:column>  

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Emprendimento" />  
                            </f:facet>  
                            <h:outputText value="#{servicoList.emprendimento}"/>  
                        </p:column>  

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Torre" />  
                            </f:facet>  
                            <h:outputText value="#{servicoList.torre}" />  
                        </p:column>  

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Unidade" />  
                            </f:facet>  
                            <h:outputText value="#{servicoList.unidade}" />  
                        </p:column> 

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Data do Serviço" />  
                            </f:facet>  
                            <h:outputText value="#{servicoList.data}" >
                                <f:convertDateTime pattern="dd/MM/yyyy"/>  
                            </h:outputText>  
                        </p:column>

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Descrição" />  
                            </f:facet>  
                            <h:outputText value="#{servicoList.descrservico}" />  
                        </p:column>

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Serviço Concluido" />  
                            </f:facet>  
                            <h:selectBooleanCheckbox value="#{servicoList.servicoconcluido}" disabled="true"/> 
                        </p:column>

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Motivo" />  
                            </f:facet>  
                            <h:outputText value="#{servicoList.motivo}" />  
                        </p:column>
                        <p:column>
                            <f:facet name="header">  
                                <h:outputText value="Ações" />
                            </f:facet>
                            <p:commandButton action="#{requestServiceSabatecBean.exclui(servicoList)}" icon="icone_delete" update=":form:tbl"/>
                            <p:commandButton id="selectButton"  oncomplete="handleComplete(args)" icon="icone_edit">
                                <f:setPropertyActionListener target="#{requestServiceSabatecBean.requestService}" value="#{servicoList}" />
                            </p:commandButton>    
                        </p:column>
                    </p:dataTable>
                </h:form>
        </h:body>
</html>